//
//  ChosePeopleLayer.h
//  identist
//
//  Created by Denveryee on 14-3-22.
//
//

#ifndef __identist__ChosePeopleLayer__
#define __identist__ChosePeopleLayer__

#include "cocos2d.h"
#include "cocos-ext.h"

USING_NS_CC;
USING_NS_CC_EXT;
using namespace gui;

#define PAGE_SUM_NUM 6 //total page num

class ChosePeopleLayer:public CCLayer
{
public:
    UIImageView* m_pImgLight[PAGE_SUM_NUM];//the current page where the lights
    
    CCLayer* upgradeLayer;
    CCLayer* shopLayer;
    
    int height;
    int shopHeight;
    
    CCMenu* menuPlay;
    UIPageView* pageView;
    
    CCSprite* bar;
    float beforeOffset;

public:
    ChosePeopleLayer();
    ~ChosePeopleLayer();
    
    void pageViewEvent(CCObject* pSender, PageViewEventType type);

    CREATE_FUNC(ChosePeopleLayer);
    bool init();
    
    void menuBackCallback();
    void menuAddMoenyCallback();
    
    void upgradeClose();
    void upgradeAddMoney();
    
    void buyMoney(cocos2d::CCObject *pSender);
    
    void shopClose();
    
    void addChosePeople(UILayout* layout, int number, bool lockFlag);
    
    void textAddShadow(UILayout* layout, const char* string, const char* fontName, float fontSize, float shadowSize, float shadowOpacity, float x, float y, const ccColor3B &color3);
    void textAddShadowAnchor(UIScrollView* layout, const char* string, const char* fontName, float fontSize, float shadowSize, float shadowOpacity, float x, float y, const ccColor3B &color3);
    void textAddShadowAnchor(CCLayer* layout, const char* string, const char* fontName, float fontSize, float shadowSize, float shadowOpacity, float x, float y, const ccColor3B &color3, float anX, float anY);
    
    void scrollEvent(CCObject *pSender, ScrollviewEventType type);
};


#endif /* defined(__identist__ChosePeopleLayer__) */
